package com.amigo.online.provider.manager.util.video.size;

import java.io.File;

import com.amigo.online.provider.manager.util.param.dto.PageDto;

import it.sauronsoftware.jave.Encoder;

public class ReadVideo {

    public static PageDto videosize(String video) {
        File source = new File(video);
        Encoder encoder = new Encoder();
        try {
            it.sauronsoftware.jave.MultimediaInfo m = encoder.getInfo(source);

            PageDto page = new PageDto();
            page.setVideoHeight(m.getVideo().getSize().getHeight());
            page.setVideoWidth(m.getVideo().getSize().getWidth());
//			System.out.println("此视频高度为:" + m.getVideo().getSize().getHeight());
//			System.out.println("此视频宽度为:" + m.getVideo().getSize().getWidth());
            return page;

        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }

    }

}
